home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr57 / nwnt.zip / NWNT.EXE / OEMNADOD.INF < prev    next >
INI File  |  1993-04-21  |  29KB  |  927 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADOD.INF
  4. ;
  5. ;       Novell Ndis to ODI network logical adapter SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. [Identification]
  10.     OptionType = NetAdapter
  11.  
  12. [PlatformsSupported]
  13.     ISA
  14.     MCA
  15.     EISA
  16.  
  17. [LanguagesSupported]
  18.     ENG
  19.  
  20. ;
  21. ; Option List   OEM Option Key Names
  22.  
  23. [Options]
  24.     ODINSUP
  25.  
  26. [OptionsTextENG]
  27.     ODINSUP     = "Novell ODINSUP Adapter"
  28.  
  29. ;
  30. ; Constants for using Dialogs
  31.  
  32. [IRQChoices]
  33. IRQ_1 = "2",2
  34. IRQ_2 = "3",3
  35. IRQ_3 = "4",4
  36. IRQ_4 = "5",5
  37.  
  38. [IOBaseAddrChoices]
  39. IOBase_1  = "0x300",768
  40. IOBase_2  = "0x320",800
  41. IOBase_3  = "0x340",832
  42. IOBase_4  = "0x360",864
  43.  
  44. [FileConstants]
  45. UtilityInf      = "UTILITY.INF"
  46. subroutineinf   = "SUBROUTN.INF"
  47. SoftwareType    = "driver"
  48. Exit_Code       = 0
  49. DriverToLoad    = ""
  50.  
  51. ;
  52. ; EventLog Message File
  53.  
  54. NetEventDLL    = "%SystemRoot%\System32\netevent.dll"
  55. IoLogMsgDLL    = "%SystemRoot%\System32\IoLogMsg.dll"
  56.  
  57. ;
  58. ; Product Info
  59.  
  60. Manufacturer    = "Novell"
  61. ProductMajorVersion    = "0"
  62. ProductMinorVersion    = "9"
  63. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  64.  
  65. ;
  66. ; Software
  67.  
  68. ProductSoftwareName     = "ODINSUP"
  69. ProductSoftwareTitle    = "Novell ODINSUP Adapter Driver"
  70. ProductSoftwareImagePath = "\SystemRoot\system32\netware\odinsup.sys"
  71. NetRuleSoftwareType     = "odinsupSys ndisDriver odinsupDriver"
  72. NetRuleSoftwareUse      = $(SoftwareType)
  73. NetRuleSoftwareBindForm = """OdinsupSys"" yes no container"
  74. NetRuleSoftwareClass    = {"odinsupDriver basic"}
  75. NetRuleSoftwareBindable = {"odinsupDriver odinsupAdapter non exclusive 100"}
  76.  
  77. ;
  78. ; Hardware
  79.  
  80. ProductHardwareName     = "ODINSUP"
  81. ProductHardwareODINSUPTitle    = "Novell ODINSUP Adapter"
  82. NetRuleHardwareType     = "odinsup odinsupAdapter"
  83. NetRuleHardwareBindForm = " yes yes container"
  84. NetRuleHardwareClass    = {"odinsupAdapter basic"}
  85.  
  86. ;
  87. ; Registry Key
  88.  
  89. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  90. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  91.  
  92. [GeneralConstants]
  93. ;
  94. ; Programe Flow control variables
  95. ;
  96. from      = ""
  97. to        = ""
  98. ;
  99. ; Return Codes; Exit_Code is set to one of these
  100. ;
  101. ExitCodeOk     = 0
  102. ExitCodeCancel = 1
  103. ExitCodeFatal  = 2
  104.  
  105. KeyNull         = ""
  106. MAXIMUM_ALLOWED   = 33554432
  107. RegistryErrorIndex = NO_ERROR
  108. KeyProduct      = ""
  109. KeyParameters   = ""
  110.  
  111. TRUE            = 1
  112. FALSE           = 0
  113. NoTitle            = 0
  114.  
  115. ExitState   = "Active"
  116. OldVersionExisted = $(FALSE)
  117.  
  118. DriverPath      = $(!STF_NTPATH)\netware
  119.  
  120. ;
  121. ; Language Dependent Dialog Constants
  122.  
  123. [FileConstantsENG]
  124. ProCaption   = "Windows NT Setup"
  125. ProCancel    = "Cance&l"
  126. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  127.                "Are you sure you want to cancel copying files?"
  128. ProCancelCap = "Network Setup Message"
  129. ProText1     = "Copying:"
  130. ProText2     = "To:"
  131.  
  132. ;
  133. ; Producr Info
  134.  
  135. FunctionTitle   = "Novell ODINSUP Network Card Setup"
  136.  
  137. ;
  138. ; Software
  139.  
  140. ProductSoftwareDescription      = "Novell ODINSUP Adapter Driver"
  141.  
  142. ;
  143. ; Hardware
  144.  
  145. ProductHardwareODINSUPDescription    = "Novell ODINSUP Adapter"
  146.  
  147. IRQList  = ^(IRQChoices, 1)
  148. IRQValues = ^(IRQChoices, 2)
  149. IOBaseAddrList = ^(IOBaseAddrChoices, 1)
  150. IOBaseAddrValues = ^(IOBaseAddrChoices, 2)
  151.  
  152. [DialogConstantsENG]
  153.  
  154. ;
  155. ; Common Button Names
  156. ;
  157.  
  158. Help        = "&Help"
  159. Exit        = "&Cancel"
  160. OK          = "&OK"
  161. HelpContext = ""
  162. Continue    = "C&ontinue"
  163. Cancel      = "C&ancel"
  164. [date]
  165.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  166.  
  167. ;
  168. ; Input DIALOGS
  169. ;
  170.  
  171. [FileDependentDlgENG]
  172. DlgType = "RadioCombination"
  173. DlgTemplate = "ODINSUP"
  174. Caption = $(FunctionTitle)
  175.  
  176. DlgText = "Please select values for the following fields:"
  177.  
  178. Label1 = "&IRQ Level:"
  179. Label2 = "I/O &Port Base Addr:"
  180.  
  181. Combo1List = $(IRQList)
  182. Combo1Out  = $(IRQValue)
  183. Combo2List = $(IOBaseAddrList)
  184. Combo2Out  = $(IOBaseAddrValue)
  185. ComboListItemsIn  = {Combo1List, Combo2List}
  186. ComboListItemsOut = {Combo1Out, Combo2Out}
  187. EditTextIn = ""
  188. EditTextLim = ""
  189. CBOptionsGreyed = {}
  190. NotifyFields = {NO, NO}
  191. HelpContext = $(!IDH_DB_OEMNADOD_INS)
  192.  
  193. ;------------------------------------------------------------------------------
  194. ; 1. Identify    To verify that this INF deals with the smae type of options
  195. ;        as we are choosing currently.
  196. ;
  197. ; Input:    none
  198. ;
  199. ; Output:    $($R0):    STATUS:    STATUS_SUCCESSFUL
  200. ;        $($R1):    Option Type (COMPUTER ...)
  201. ;        $($R2):    Diskette Description
  202. ;------------------------------------------------------------------------------
  203.  
  204. [Identify]
  205.     ;
  206.     ;
  207.     read-syms Identification
  208.     set Status     = STATUS_SUCCESSFUL
  209.     set Identifier = $(OptionType)
  210.     set Media      = #("Source Media Descriptions", 1, 1)
  211.  
  212.     Return $(Status) $(Identifier) $(Media)
  213.  
  214. ;------------------------------------------------------------------------------
  215. ; 2. ReturnOptions    To return the option list supported by this INF and
  216. ;            the localized text list representing the options.
  217. ; Input:    $($0):    Lang. used (ENG | FRN | ....)
  218. ;
  219. ; Output:    $($R0):    STATUS:    STATUS_SUCCESSFUL    |
  220. ;                STATUS_NOLANGUAGE    |
  221. ;                STATUS_FAILED        |
  222. ;                STATUS_NOTSUPPORTED
  223. ;        $($R1):    Option List
  224. ;        $($R2):    Option Text List
  225. ;
  226. ;------------------------------------------------------------------------------
  227.  
  228. [ReturnOptions]
  229.     set Status        = STATUS_FAILED
  230.     set OptionList     = {}
  231.     set OptionTextList = {}
  232.  
  233.     ;
  234.     ; Check if the language requested is supported
  235.  
  236.     set LanguageList = ^(LanguagesSupported, 1)
  237.  
  238.     Ifcontains(i) $($0) in $(LanguageList)
  239.         ifstr(i) $($1) == ""
  240.         goto returnoptions
  241.         endif
  242.         set PlatformList = ^(PlatformsSupported, 1)
  243.         Ifcontains(i) $($1) in $(PlatformList)
  244.         goto returnoptions
  245.         else
  246.         set Status = STATUS_NOTSUPPORTED
  247.         goto finish_ReturnOptions
  248.         endif
  249.     else
  250.     set Status = STATUS_NOLANGUAGE
  251.     goto finish_ReturnOptions
  252.     endif
  253.  
  254.     ;
  255.     ; form a list of all the options and another of the text representing
  256.  
  257. returnoptions = +
  258.     set OptionList     = ^(Options, 1)
  259.     set OptionTextList = ^(OptionsText$($0), 1)
  260.     set Status         = STATUS_SUCCESSFUL
  261.  
  262. finish_ReturnOptions = +
  263.     Return $(Status) $(OptionList) $(OptionTextList)
  264.  
  265.  
  266.  
  267. ;------------------------------------------------------------------------------
  268. ; 2. InstallOption    This section is shelled to by main installation processing
  269. ;
  270. ; Function:    To copy files representing Options
  271. ;        To configure the installed option
  272. ;        To update the Registry for the installed option
  273. ;
  274. ; Input:    $($0):    Lang. to use
  275. ;        $($1):    OptionID to install
  276. ;        $($2):    SourceDirectory
  277. ;        $($3):    AddCopy        ( YES | NO )
  278. ;        $($4):    DoCopy        ( YES | NO )
  279. ;        $($5):    DoConfig    ( YES | NO )
  280. ;
  281. ; Output:    $($R0):    STATUS:    STATUS_SUCCESSFUL    |
  282. ;                STATUS_NOLANGUAGE    |
  283. ;                STATUS_USERCANCEL    |
  284. ;                STATUS_FAILED        |
  285. ;                STATUS_NOTSUPPORTED
  286. ;
  287. ;------------------------------------------------------------------------------
  288.  
  289. [InstallOption]
  290.  
  291.  
  292.     ;
  293.     ; Set default values for
  294.  
  295.     set Status   = STATUS_FAILED
  296.  
  297.     ;
  298.     ; extract parameters
  299.  
  300.     set Option   = $($1)
  301.     set !SrcDir   = $($2)
  302.     set !AddCopy  = $($3)
  303.     set !DoCopy   = $($4)
  304.     set !DoConfig = $($5)
  305.  
  306.     ;
  307.     ; Check if the language requested is supported
  308.  
  309.     set LanguageList = ^(LanguagesSupported, 1)
  310.     Ifcontains(i) $($0) in $(LanguageList)
  311.     goto installoption
  312.     else
  313.     set Status = STATUS_NOLANGUAGE
  314.     goto finish_InstallOption
  315.     endif
  316.  
  317. installoption = +
  318.  
  319. ;
  320. ; Verify NCPA variables.
  321. ; Set the InstallMode to "install"
  322.  
  323. ;    set !NTN_InstallMode  = "install"
  324.  
  325. ;
  326. ; Tell the common code that we're being called from "main install"
  327.  
  328.     ifstr(i) $(!NTN_Origination) != "NCPA"
  329.     set !NTN_Origination = "install"
  330.     endif
  331.  
  332. ;
  333. ; Call the CommonSection
  334.  
  335.     shell "" CommonSection $(Option)
  336.     set Status = $($R0)
  337.     ifstr(i) $($R1) != ""
  338.     set DriverToLoad = { $($R1) }
  339.     else
  340.     set DriverToLoad = ""
  341.     endif
  342.     Return $(Status) $(DriverToLoad)
  343. [NcpaInvocation]
  344.     set Option   = $(!NTN_InfOption)
  345.     set !SrcDir   = $(!STF_SRCDIR)
  346.     Ifstr(i) $(!NTN_InstallMode) == install
  347.     set !AddCopy  = YES
  348.     set !DoCopy   = YES
  349.     set !DoConfig = YES
  350.     Else
  351.     set !AddCopy  = NO
  352.     set !DoCopy   = NO
  353.     set !DoConfig = NO
  354.     Endif
  355.     shell "" CommonSection $(Option)
  356.     set Status = $($R0)
  357.     Return $(Status)
  358. [CommonSection]
  359.     StartWait
  360.     set Option = $($0)
  361.     set-subst LF = "\n"
  362.     read-syms GeneralConstants
  363.     read-syms FileConstants
  364.     read-syms DialogConstants$(!STF_LANGUAGE)
  365.     read-syms FileConstants$(!STF_LANGUAGE)
  366.     detect date
  367.     set-title  $(FunctionTitle)
  368.     set to   = Begin
  369.     set from = Begin
  370.     set CommonStatus = STATUS_SUCCESSFUL
  371.     EndWait
  372. Begin = +
  373.     Debug-Output "OEMNADOD.INF: Begin Install Mode = "$(!NTN_InstallMode)
  374.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  375.         set StartLabel = removeadapter
  376.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  377.             set StartLabel = UpgradeSoftware
  378.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  379.         set StartLabel = bindingadapter
  380.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  381.         set StartLabel = configureadapter
  382.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  383.             Debug-Output "OEMNADOD.INF: Cannot configure the Novell ODINSUP driver software."
  384.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  385.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  386.                 Debug-Output "OEMNADOD.INF: ShellCode error: cannot get an error string."
  387.                 goto ShellCodeError
  388.             endif
  389.             set Error = $($R0)
  390.             set from = end
  391.             set to = end
  392.             goto Warning
  393.         endif
  394.     else
  395.         set StartLabel = installadapter
  396.         set OEM_ABANDON_OPTIONS = {}
  397.         set OEM_ABANDON_SOFTWARE = FALSE
  398.         set OEM_ABANDON_ON = TRUE
  399.     endif
  400.     set IRQValue = *($(IRQList), 2)
  401.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  402.     set from = $(fatal)
  403.     set to = $(fatal)
  404.     goto $(StartLabel)
  405. installadapter = +
  406.     Debug-Output "OEMNADOD.INF: installadapter"
  407.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  408.     Ifstr $(KeyProduct) != $(KeyNull)
  409.     CloseRegKey $(KeyProduct)
  410.     ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
  411.        Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  412.            $(ProductVersion)
  413.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  414.            Debug-Output $(!STF_ONTEXTINFNAME)": ShellCode error: cannot get an error string."
  415.            goto ShellCodeError
  416.        endif
  417.        goto end
  418.     else
  419.        Shell $(UtilityInf), CardExistedDlg
  420.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  421.            Debug-Output "OEMNADOD.INF: ShellCode error: cannot get an error string."
  422.            goto ShellCodeError
  423.        endif
  424.        ifstr(i) $($R1) != "OK"
  425.            goto end
  426.        endif
  427.        set OldVersionExisted = $(TRUE)
  428.     endif
  429.     endif
  430.     goto adapteroptions
  431. configureadapter = +
  432.     Ifstr $(KeyProduct) == $(KeyNull)
  433.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  434.     Ifstr $(KeyProduct) == $(KeyNull)
  435.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  436.         Debug-Output "OEMNADOD.INF: Cannot find component product key"
  437.         goto fatalregistry
  438.     Endif
  439.     Endif
  440.     Debug-Output "OEMNADOD.INF: Shelling to FindService"
  441.     Shell $(UtilityInf) FindService, $(KeyProduct)
  442.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  443.     Debug-Output "OEMNADOD.INF: FindService shell failure"
  444.     Goto ShellCodeError
  445.     Endif
  446.     Ifstr(i) $($R0) != NO_ERROR
  447.     Debug-Output "OEMNADOD.INF: FindService Shell error: "$($R0)
  448.     Goto fatalregistry
  449.     endif
  450.     set KeyParameters = $($R2)
  451.     CloseRegKey $($R1)
  452.     Ifstr $(KeyParameters) == $(KeyNull)
  453.     set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  454.     Debug-Output "OEMNADOD.INF: Cannot find component service"
  455.     goto fatalregistry
  456.     endif
  457.     set OldVersionExisted = $(TRUE)
  458.     set ValueName = ""
  459.     set ValueData = ""
  460.     set ValueStr  = ""
  461.     set ValueList = {}
  462.     EnumRegValue $(KeyParameters) ValueList
  463.     ForListDo $(ValueList)
  464.     set ValueItem = $($)
  465.     set ValueName = *($(ValueItem),1)
  466.     set ValueData = *($(ValueItem),4)
  467.     Ifstr(i) $(ValueName) == "InterruptNumber"
  468.         set IRQValueIndex = $(ValueData)
  469.     else-ifstr(i) $(ValueName) == "IoBaseAddress"
  470.         set IOBaseAddrIndex = $(ValueData)
  471.     endif
  472.     EndForListDo
  473.     set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  474.     ifstr(i) $(IRQValue) == ""
  475.     set IRQValue = *($(IRQList), 2)
  476.     endif
  477.     set IOBaseAddrValue = *($(IOBaseAddrList), +
  478.      ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  479.     ifstr(i) $(IOBaseAddrValue) == ""
  480.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  481.     endif
  482.     goto adapteroptions
  483. adapteroptions = +
  484.     Debug-Output "OEMNADOD.INF: adapteroptions"
  485.     set from = adapteroptions
  486.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  487. ;    ui start "InputDlg"
  488. ;    ifstr(i) $(DLGEVENT) == "CONTINUE"
  489. ;        set IRQValueIndex = $(Combo1Out)
  490. ;        set IOBaseAddrIndex = $(Combo2Out)
  491. ;        ui pop 1
  492. ; TWM set dummy values for IRQ, IOBase
  493. ;
  494.         set IRQValueIndex = "3"
  495.         set IOBaseAddrIndex = "300"
  496.         goto nextstep
  497.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  498.         set CommonStatus = STATUS_USERCANCEL
  499.         Debug-Output "Action: exit. Bye."
  500.         ui pop 1
  501.         goto end
  502.     else
  503.         ui pop 1
  504.         Debug-Output "Action: unknown. Bye."
  505.         goto end
  506.     endif
  507. nextstep = +
  508.     ifint $(OldVersionExisted) == $(TRUE)
  509.         ifstr(i) $(!NTN_InstallMode) == configure
  510.             goto writeparameters
  511.         endif
  512.     endif
  513.     StartWait
  514. installproduct = +
  515.     ifint $(OldVersionExisted) == $(FALSE)
  516.         Debug-Output "OEMNADOD.INF: First Time Install"
  517. ;        ifstr(i) $(!NTN_Origination) == "NCPA"
  518. ;            Ifstr(i) $(!DoCopy) == "YES"
  519. ;                Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)
  520. ;                Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  521. ;                    Goto fatal
  522. ;                Else-Ifstr(i) $($R0) == STATUS_FAILED
  523. ;                    Goto fatal
  524. ;                Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  525. ;                    Goto installstep1
  526. ;                Endif
  527. ;                Set !STF_SRCDIR = $($R1)
  528. ;            Endif
  529. ;            install "Install-Option"
  530. ;            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  531. ;              goto fatal
  532. ;            endif
  533. ;        endif
  534.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  535.             $(ProductSoftwareName), +
  536.             $(ProductSoftwareName), +
  537.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  538.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  539.             $(NetEventDLL)
  540.         Set OEM_ABANDON_SOFTWARE = TRUE
  541.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  542.             Debug-Output "ShellCode error"
  543.             goto ShellCodeError
  544.         endif
  545.         set RegistryErrorIndex = $($R0)
  546.         set KeyProduct      = $($R1)
  547.         Set SoftNetRulesKey = $($R2)
  548.         CloseRegKey $($R3)
  549.         CloseRegKey $($R4)
  550.         CloseRegKey $($R5)
  551.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  552.             EndWait
  553.             Debug-Output "Registry error: add software components"
  554.             CloseRegKey $(KeyProduct)
  555.             CloseRegKey $(SoftNetRulesKey)
  556.             goto fatalregistry
  557.         endif
  558.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  559.                    {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  560.                    {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  561.                    {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  562.                    {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  563.                    {PathName,$(NoTitle),$(!REG_VT_SZ),$(!STF_CWDDIR)},+
  564.                    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  565.                    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  566.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  567.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  568.             Debug-Output "ShellCode error."
  569.             goto ShellCodeError
  570.         endif
  571.         set RegistryErrorIndex = $($R0)
  572.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  573.             EndWait
  574.             Debug-Output "Registry error: add value list."
  575.             CloseRegKey $(KeyProduct)
  576.             CloseRegKey $(SoftNetRulesKey)
  577.             goto fatalregistry
  578.         endif
  579.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  580.                     {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  581.                     {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  582.                     {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  583.                     {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  584.                     {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, +
  585.                     {Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)} }
  586.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  587.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  588.             Debug-Output "ShellCode error."
  589.             goto ShellCodeError
  590.         endif
  591.         set RegistryErrorIndex = $($R0)
  592.         CloseRegKey $(KeyProduct)
  593.         CloseRegKey $(SoftNetRulesKey)
  594.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  595.             EndWait
  596.             Debug-Output "Resgitry error: add value list."
  597.             goto fatalregistry
  598.         endif
  599.     endif
  600.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  601.     ifint $($R4) != -1
  602.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  603.     endif
  604.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  605.         Debug-Output "Cannot add hardware component"
  606.         goto ShellCodeError
  607.     endif
  608.     set RegistryErrorIndex = $($R0)
  609.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  610.         EndWait
  611.         Debug-Output "Registry error: add hardware component"
  612.         CloseRegKey $($R1)
  613.         CloseRegKey $($R2)
  614.         CloseRegKey $($R3)
  615.         goto fatalregistry
  616.     endif
  617.     set KeyParameters = $($R3)
  618.     set KeyAdapterRules = $($R2)
  619.     set AdapterNumber = $($R4)
  620.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  621.                {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  622.                {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  623.                {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  624.                {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  625.                {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  626.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  627.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  628.         Debug-Output "ShellCode error"
  629.         goto ShellCodeError
  630.     endif
  631.     CloseRegKey $($R1)
  632.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  633.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  634.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  635.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  636.             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  637.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}, +
  638.             {Infname ,$(NoTitle),$(!REG_VT_SZ),$(STF_CONTEXTINFNAME)}}
  639.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  640.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  641.         Debug-Output "ShellCode error."
  642.         goto ShellCodeError
  643.     endif
  644.     set RegistryErrorIndex = $($R0)
  645.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  646.         EndWait
  647.         Debug-Output "Resgitry error: add value list."
  648.         CloseRegKey $(KeyParameters)
  649.         CloseRegKey $(KeyAdapterRules)
  650.         goto fatalregistry
  651.     endif
  652.     CloseRegKey $(KeyAdapterRules)
  653.     goto writeparameters
  654. writeparameters = +
  655.     set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueIndex)))
  656.     set IOBaseAddrValue = *($(IOBaseAddrValues), +
  657.      ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
  658. ;
  659. ; BUG, BUG Need to get OdinsupBindName from the registry, if more than one
  660. ; board is in the registry need to do a dialog box and allow the user to
  661. ; select the adapter.
  662. ;
  663. ; For now use the last adapter found that's not a Token Ring adapter since
  664. ; Odinsup does not support Token Ring at this time.
  665. ;
  666.  
  667.     set OdiModulesName = $(!NTN_ServiceBase)"\OdiLoad\ODI_Modules"
  668.     OpenRegKey $(!REG_H_LOCAL) "" $(OdiModulesName) $(MAXIMUM_ALLOWED) KeyOdiModules
  669.     EnumRegKey $(KeyOdiModules) CardList
  670.  
  671.     set OdinsupBindName = "ne2000"
  672.  
  673.     set FoundEtherCard = 0
  674.  
  675.     ForListDo $(CardList)
  676.         set CardName = *($($),1)
  677.     Split-String $(CardName) " " CardNameParts
  678.     set CardBaseName = *($(CardNameParts),1)
  679.     Ifstr(i) CardBaseName != "Token"
  680.        set FoundEtherCard = 1
  681.        set OdinsupBindName = $(CardBaseName)
  682.        Debug-Output "OEMNADOD.INF: Bind to adapter "$(CardBaseName)
  683.     Endif
  684.     EndForListDo
  685.  
  686.     Ifint $(FoundEtherCard) == 0
  687.         Debug-Output "OEMNADOD.INF: No ethernet adapters found"
  688.     Debug-Output "OEMNADOD.INF: Odinsup will NOT work on Token Ring"
  689.     Endif
  690.  
  691.     set NewValueList = {{InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQValue)},+
  692.                 {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  693.                {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  694.                {Bind,$(NoTitle),$(!REG_VT_SZ),$(OdinsupBindName)},+
  695.                {BoardInstance,$(NoTitle),$(!REG_VT_DWORD),1} }
  696.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  697.     CloseRegKey $(KeyParameters)
  698.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  699.         Debug-Output "ShellCode error."
  700.         goto ShellCodeError
  701.     endif
  702.     set RegistryErrorIndex = $($R0)
  703.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  704.         Debug-Output "Registry error: Add value list"
  705.         goto fatalregistry
  706.     endif
  707.     EndWait
  708.     Set DriverToLoad = $(ProductSoftwareName)
  709.     goto successful
  710. bindingadapter =+
  711.     set Error = "Binding: Sorry, not yet implemented."
  712.     goto fatal
  713. removeadapter = +
  714.     Debug-Output "OEMNADOD.INF: removeadapter"
  715.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  716.             Debug-Output "OEMNADOD.INF: RemoveSoftwareComponent"
  717.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  718.                 $(ProductSoftwareName)
  719.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  720.                 Debug-Output "ShellCode error"
  721.                 goto ShellCodeError
  722.         endif
  723.         set RegistryErrorIndex = $($R0)
  724.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  725.                 goto fatalregistry
  726.         endif
  727.     else
  728.             Debug-Output "OEMNADOD.INF: RemoveHardwareComponent"
  729.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  730.             $(ProductSoftwareName), $(!NTN_RegBase)     
  731.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  732.                 Debug-Output "ShellCode error"
  733.                 goto ShellCodeError
  734.         endif
  735.         set RegistryErrorIndex = $($R0)
  736.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  737.                 goto fatalregistry
  738.         endif
  739.     endif
  740.     goto end
  741. UpgradeSoftware = +
  742.     Debug-Output "OEMNADOD.INF: UpgradeSoftware"
  743.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  744.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  745.         Ifstr $(KeyProduct) != $(KeyNull)
  746.         GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  747.         set Version = *($(VersionInfo), 4)
  748.         Split-String $(!NTN_Infname), "\", FilenameList
  749.         QueryListSize ListSize $(FilenameList)
  750.         set !UG_Filename = *($(FilenameList), $(ListSize))
  751.              install "Install-Update"
  752.              ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  753.                  goto fatal
  754.              endif
  755.         SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  756.         SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  757.         ifint $(Version) != $(ProductVersion)
  758.         endif
  759.         CloseRegKey $(KeyProduct)
  760.         else
  761.         goto fatalregistry
  762.         endif
  763.     else
  764.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  765.             $(MAXIMUM_ALLOWED) NetworkCardKey
  766.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  767.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  768.         set ServiceName = *($(ServiceNameInfo), 4)
  769.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  770.             $(MAXIMUM_ALLOWED) NetRuleKey
  771.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  772.         else
  773.         goto fatalregistry
  774.         endif
  775.         CloseRegKey $(NetRules)
  776.         CloseRegKey $(NetworkCardKey)
  777.         else
  778.         goto fatalregistry
  779.         endif
  780.         OpenRegKey $(!REG_H_LOCAL) "" +
  781.             $(!NTN_ServiceBase)"\"$(ServiceName) +
  782.             $(MAXIMUM_ALLOWED) ServiceKey
  783.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  784.         CloseRegKey $(ServiceKey)
  785.         else
  786.         goto fatalregistry
  787.     endif
  788.     endif
  789.     goto end
  790. successful = +
  791.      Debug-Output "OEMNADOD.INF: Successful; installing [InstallOption], DoCopy = "$(!DoCopy)
  792. ;    ifstr(i) $(!NTN_Origination) == "install"
  793. ;        Ifstr(i) $(!DoCopy) == "YES"
  794. ;          Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)
  795. ;          Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  796. ;              Goto fatal
  797. ;          Else-Ifstr(i) $($R0) == STATUS_FAILED
  798. ;              Goto fatal
  799. ;          Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  800. ;              Goto installstep1
  801. ;          Endif
  802. ;          Set !STF_SRCDIR = $($R1)
  803. ;        Endif
  804. ;        install "Install-Option"
  805. ;        ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  806. ;          goto fatal
  807. ;        endif
  808. ;    endif
  809.     goto installstep1
  810. installstep1 = +
  811.     goto end
  812. abandon = +
  813.     Debug-Output "OEMNADOD.INF: abandon"
  814.     ForListDo $(OEM_ABANDON_OPTIONS)
  815.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  816.         $(ProductSoftwareName), $($)     
  817.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  818.             Debug-Output "ShellCode error"
  819.             goto ShellCodeError
  820.     endif
  821.     set RegistryErrorIndex = $($R0)
  822.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  823.             goto fatalregistry
  824.     endif
  825.     EndForListDo
  826.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  827.     Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  828.             $(ProductSoftwareName), FALSE
  829.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  830.             Debug-Output "ShellCode error"
  831.             goto ShellCodeError
  832.     endif
  833.     set RegistryErrorIndex = $($R0)
  834.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  835.             goto fatalregistry
  836.     endif
  837.     endif
  838.     goto end
  839. warning = +
  840.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  841.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  842.     goto ShellCodeError
  843.     endif
  844.     ifstr(i) $($R1) == "OK"
  845.     goto $(to)
  846.     else-ifstr(i) $($R1) == "CANCEL"
  847.     goto $(from)
  848.     else
  849.     goto "end"
  850.     endif
  851. nonfatal = +
  852.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(Error)
  853.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  854.     goto ShellCodeError
  855.     endif
  856.     ifstr(i) $($R1) == "OK"
  857.     goto $(from)
  858.     else
  859.     goto "end"
  860.     endif
  861. fatalregistry = +
  862.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  863.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  864.     goto ShellCodeError
  865.     endif
  866.     set Error = $($R0)
  867.     goto fatal
  868. fatal = +
  869.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  870.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  871.     goto ShellCodeError
  872.     endif
  873.     goto setfailed
  874. ShellCodeError = +
  875.     set DlgType      = "MessageBox"
  876.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  877.     set STF_MB_TEXT  = "Shell Code Error"
  878.     set STF_MB_TYPE  = 1
  879.     set STF_MB_ICON  = 3
  880.     set STF_MB_DEF   = 1
  881.     ui start "Error Message"
  882.     goto setfailed
  883. setfailed = +
  884.     set CommonStatus = STATUS_FAILED
  885.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  886.         set OEM_ABANDON_ON = FALSE
  887.     goto abandon
  888.     endif
  889.     goto end
  890. end = +
  891.     goto term
  892. term = +
  893.     Return $(CommonStatus) $(DriverToLoad)
  894. [Install-Option]
  895.     set STF_VITAL = ""
  896.     ifstr(i) $(!AddCopy) == "YES"
  897.     AddSectionFilesToCopyList Files-$(Option) $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)\netware
  898.     endif
  899.     ifstr(i) $(!DoCopy) == "YES"
  900.        CopyFilesInCopyList
  901.     endif
  902.     ifstr(i) $(!DoConfig) == "YES"
  903.     endif
  904.     Exit
  905. [Install-Update]
  906.    Debug-Output "OEMNADOD.INF: Install-Update"
  907.    set STF_VITAL     = ""
  908.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  909.    AddSectionFilesToCopyList Files-$(Option) $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)\netware
  910.    AddSectionFilesToCopyList Files-Inf $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
  911.    CopyFilesInCopyList
  912.    exit
  913. [Source Media Descriptions]
  914.     1  = "Windows NT Setup Disk #1"  , TAGFILE = disk1
  915.     2  = "Windows NT Setup CD-ROM Disk"  , TAGFILE = disk2
  916.     3  = "Netware for NT Disk #1",  TAGFILE = ODINSUP.SYS
  917. [ProductType]
  918. STF_PRODUCT  = Winnt
  919. STF_PLATFORM = I386
  920. [Files-Inf]
  921. 3, oemnadod.inf, SIZE=1000
  922. [Files-ODINSUP]
  923. 3, odinsup.sys,  SIZE=72192
  924.  
  925.  
  926.  
  927.